/*
 * 
 *intput:data={dri_id[0]:
 *              dri_di[1]:
 *              ...
 *              }
 *              
 * need callback?        input is jason?              
 */

var config = require("../config/notification.json");
var restify = require('restify');

// "http://localhost:8060/dev/invoke?adapter=FTPushAdapter&procedure=submitNotification&parameters=[$customerId,$message]"
// http://localhost:10080/SmartTest7-17/dev/invoke?adapter=stAdp&procedure=submitNotification&parameters=[%2713456789098%27,%27hello%27]
function notification(userId, message, callback) {
	this.host = config.host + ':' + config.port;
/*	this.path = config.path + '?adapter=' + config.adapter + '&procedure='
			+ config.procedure + '&parameters=[' + encodeURIComponent("'" + userId + "'") + ',' + encodeURIComponent("'" + message + "'") + ']';*/
	this.path = config.path + '?adapter=' + config.adapter + '&procedure='
	+ config.procedure + '&parameters=[' + "'" + userId + "'" + ',' + "'" + message + "'" + ']';
	
	this.client = restify.createStringClient({
		url : this.host
	});
	this.client.get(this.path, callback);
}

module.exports = notification;